<?php

/**
 * Menashop
 *
 * LICENSE
 *
 * This source file is subject to the license that is bundled
 * with this project in the file LICENSE.txt
 *
 * @category   Zend
 * @package    Admin_Model
 * @subpackage FormLogin
 * @copyright  Copyright (c) 2011 Menashop UA Inc. (http://www.menashop.com.ua)
 * @license    LICENSE.txt
 * @version    1.0.0
 * @since      File available since Release 1.0.0
 */

/**
 * The form for login
 * 
 * @category   Zend
 * @package    Admin_Model
 * @subpackage FromLogin
 * @copyright  Copyright (c) 2011 Menashop UA Inc. (http://www.menashop.com.ua)
 * @license    LICENSE.txt
 */
class Admin_Model_FormLogin extends Zend_Form
{

    public function init()
    {   
        $this->setMethod('post');

        $email = new Zend_Form_Element_Text('email');
        $email->setRequired(true);
        $email->addErrorMessage('Please provide a correct e-mail');
        $email->addValidator('EmailAddress');
        $email->setLabel('E-mail');
        $email->removeDecorator('label');
        $email->removeDecorator('htmlTag');
        $email->removeDecorator('Errors');
        $this->addElement($email);

        $pswd = new Zend_Form_Element_Password('password');
        $pswd->setRequired(true);
        $pswd->addValidator('StringLength', false, array(6,15));
        $pswd->setLabel('Password');
        $pswd->addErrorMessage('Please provide your password');
        $pswd->removeDecorator('label');
        $pswd->removeDecorator('htmlTag');
        $pswd->removeDecorator('Errors');
        $this->addElement($pswd);
        

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Login');
        $submit->removeDecorator('DtDdWrapper');
        $this->addElement($submit);
        
        $this->setDecorators( array( array('ViewScript', array('viewScript' => '_form_login.phtml'))));
    } 

}

